package org.graduation.user.service;


import com.baomidou.mybatisplus.extension.service.IService;
import org.graduation.common.ServiceException;
import org.graduation.model.common.ResponseResult;
import org.graduation.model.common.user.User;
import org.graduation.model.dtos.RegisterDTO;

public interface UserService extends IService<User> {
    /**
     * 登录，返回Token字符串
     *
     * @param user
     * @return
     */
    ResponseResult login(User user) throws ServiceException;

    /**
     * 退出登录
     *
     * @param token
     */
    void logout(String token);

    /**
     * 拿旧的token换新的token
     *
     * @param token
     * @return
     */
    ResponseResult swapToken(String token);

    /**
     * 注册，注册之前需要获取验证码，之后将基本信息和验证码一起传给此接口。
     *
     * @param registerDTO
     * @return
     * @throws ServiceException
     */
    ResponseResult register(RegisterDTO registerDTO) throws ServiceException;

    ResponseResult getInfoByEmail(String email);
}
